//
//  NSObject+Extension.swift
//  DetailList
//
//  Created by mayuncui on 2020/9/23.
//  Copyright © 2020 Myc. All rights reserved.
//

import Foundation

fileprivate var RTime_UsInfo = "RTime_UsInfo"

protocol Builder{}
extension Builder {
    @discardableResult
    public func with(_ with:(inout Self)->Void)->Self {
        var this = self
        with(&this)
        return this
    }
}

extension NSObject: Builder {
    var usInfo:[AnyHashable:Any]? {
        set {
            objc_setAssociatedObject(self, &RTime_UsInfo, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        } get {
            return objc_getAssociatedObject(self, &RTime_UsInfo) as? [AnyHashable:Any]
        }
    }
}
